package com.lpit.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;




/**
* 文章表
* @TableName article
*/
@TableName(value ="article")
@Data
public class Article implements Serializable {
    /**
    * 文章id
    */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
    * 文章标题
    */
    private String articleTitle;

    /**
    * 文章封面
    */
    private String articleCover;

    /**
    * 文章内容
    */
    private String articleBody;

    /**
    * 发布时间（修改时间）
    */
    private Date articleTime;

    /**
    * 文章文档链接
    */
    private String articleLink;

    /**
    * 文章点赞数
    */
    private Integer articleLikenum;

    /**
    * 文章被收藏数
    */
    private Integer articleCollection;

    /**
    * 文章状态（已发布，草稿箱，私密文章）
    */
    private String articleStatus;

    /**
    * 文章评论状态(是否开启评论)
    */
    private String articleCommentStatus;

    /**
    * 发布状态（审核中，审核失败，封禁）
    */
    private String articleAuditStatus;

    /**
    * 文章所属用户id
    */
    private Integer userId;

    /**
    * 文章所在频道id
    */
    private Integer channelId;

    /**
    * 参加的活动id
    */
    private Integer activityId;

    /**
    * 投放的广告id
    */
    private Integer advertisingId;

    /**
    * 文章置顶
    */
    private Integer isTop;

    /**
    * 权重大小(数字越大,优先级越高,没有置顶为0,默认为0)
    */
    private Integer weightNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
    if (this == that) {
        return true;
    }
    if (that == null) {
        return false;
    }
    if (getClass() != that.getClass()) {
        return false;
    }
    Article other = (Article) that;
    return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
        && (this.getArticleTitle() == null ? other.getArticleTitle() == null : this.getArticleTitle().equals(other.getArticleTitle()))
        && (this.getArticleCover() == null ? other.getArticleCover() == null : this.getArticleCover().equals(other.getArticleCover()))
        && (this.getArticleBody() == null ? other.getArticleBody() == null : this.getArticleBody().equals(other.getArticleBody()))
        && (this.getArticleTime() == null ? other.getArticleTime() == null : this.getArticleTime().equals(other.getArticleTime()))
        && (this.getArticleLink() == null ? other.getArticleLink() == null : this.getArticleLink().equals(other.getArticleLink()))
        && (this.getArticleLikenum() == null ? other.getArticleLikenum() == null : this.getArticleLikenum().equals(other.getArticleLikenum()))
        && (this.getArticleCollection() == null ? other.getArticleCollection() == null : this.getArticleCollection().equals(other.getArticleCollection()))
        && (this.getArticleStatus() == null ? other.getArticleStatus() == null : this.getArticleStatus().equals(other.getArticleStatus()))
        && (this.getArticleCommentStatus() == null ? other.getArticleCommentStatus() == null : this.getArticleCommentStatus().equals(other.getArticleCommentStatus()))
        && (this.getArticleAuditStatus() == null ? other.getArticleAuditStatus() == null : this.getArticleAuditStatus().equals(other.getArticleAuditStatus()))
        && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
        && (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
        && (this.getActivityId() == null ? other.getActivityId() == null : this.getActivityId().equals(other.getActivityId()))
        && (this.getAdvertisingId() == null ? other.getAdvertisingId() == null : this.getAdvertisingId().equals(other.getAdvertisingId()))
        && (this.getIsTop() == null ? other.getIsTop() == null : this.getIsTop().equals(other.getIsTop()))
        && (this.getWeightNum() == null ? other.getWeightNum() == null : this.getWeightNum().equals(other.getWeightNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getArticleTitle() == null) ? 0 : getArticleTitle().hashCode());
        result = prime * result + ((getArticleCover() == null) ? 0 : getArticleCover().hashCode());
        result = prime * result + ((getArticleBody() == null) ? 0 : getArticleBody().hashCode());
        result = prime * result + ((getArticleTime() == null) ? 0 : getArticleTime().hashCode());
        result = prime * result + ((getArticleLink() == null) ? 0 : getArticleLink().hashCode());
        result = prime * result + ((getArticleLikenum() == null) ? 0 : getArticleLikenum().hashCode());
        result = prime * result + ((getArticleCollection() == null) ? 0 : getArticleCollection().hashCode());
        result = prime * result + ((getArticleStatus() == null) ? 0 : getArticleStatus().hashCode());
        result = prime * result + ((getArticleCommentStatus() == null) ? 0 : getArticleCommentStatus().hashCode());
        result = prime * result + ((getArticleAuditStatus() == null) ? 0 : getArticleAuditStatus().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
        result = prime * result + ((getActivityId() == null) ? 0 : getActivityId().hashCode());
        result = prime * result + ((getAdvertisingId() == null) ? 0 : getAdvertisingId().hashCode());
        result = prime * result + ((getIsTop() == null) ? 0 : getIsTop().hashCode());
        result = prime * result + ((getWeightNum() == null) ? 0 : getWeightNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", articleTitle=").append(articleTitle);
        sb.append(", articleCover=").append(articleCover);
        sb.append(", articleBody=").append(articleBody);
        sb.append(", articleTime=").append(articleTime);
        sb.append(", articleLink=").append(articleLink);
        sb.append(", articleLikenum=").append(articleLikenum);
        sb.append(", articleCollection=").append(articleCollection);
        sb.append(", articleStatus=").append(articleStatus);
        sb.append(", articleCommentStatus=").append(articleCommentStatus);
        sb.append(", articleAuditStatus=").append(articleAuditStatus);
        sb.append(", userId=").append(userId);
        sb.append(", channelId=").append(channelId);
        sb.append(", activityId=").append(activityId);
        sb.append(", advertisingId=").append(advertisingId);
        sb.append(", isTop=").append(isTop);
        sb.append(", weightNum=").append(weightNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
